package tests;

import common.Utils;
import org.openqa.selenium.By;

public class TemplatePage extends Utils {
    public static String url = "http://49.235.61.184:8080/template";

    public TemplatePage() {
        super(url);
    }
    //检查模块广场的页面
    public void checkTemplate_Square(){
        //检查模块广场的标题是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-has-footer.ant-page-header-ghost > div.ant-page-header-heading > div > span"));
        //检查搜索模板的搜索框是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-has-footer.ant-page-header-ghost > div.ant-page-header-content > div > div > div > div > div"));
        //查看分类标签是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-has-footer.ant-page-header-ghost > div.ant-page-header-footer > div > div.ant-tabs-nav > div.ant-tabs-nav-wrap > div"));
        //检查添加模板的按钮是否可见并使用
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-page-header.ant-pro-page-container-warp-page-header.ant-pro-page-container-warp-page-header.ant-page-header-has-breadcrumb.ant-page-header-has-footer.ant-page-header-ghost > div.ant-page-header-heading > span > div > div > button")).click();
        //验证是否可以跳转
        driver.findElement(By.cssSelector("#editor > div.survey-sidebar-panel > div.survey-sidebar-panel-tabs > div.survey-sidebar-panel-tabs-pane.active"));
        System.out.println("添加模板的页面验证成功");
        //退出
        driver.findElement(By.cssSelector("#editor > div.survey-main-panel > div.survey-main-panel-toolbar > div:nth-child(2) > div > button.ant-btn.ant-btn-primary.ant-btn-sm.ant-btn-dangerous")).click();

        //检查分类和标签框是否可见
        driver.findElement(By.cssSelector("#sk-layout > div > div > section > div.ant-pro-layout-container > main > div > div.ant-pro-grid-content > div > div > div > div.ant-card > div"));

        System.out.println("模块广场页面检查结束");
        //保留url
        detailUrl = driver.getCurrentUrl();
    }


}
